home *** CD-ROM | disk | FTP | other *** search
- package sun.applet;
-
- import java.applet.AppletContext;
- import java.awt.Component;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.util.Hashtable;
-
- class AppletViewerPanel extends AppletPanel {
- URL documentURL;
- URL baseURL;
- Hashtable atts;
-
- AppletViewerPanel(URL var1, Hashtable var2) {
- this.documentURL = var1;
- this.atts = var2;
- String var3 = this.getParameter("zipbase");
- if (var3 != null && !var3.endsWith("/")) {
- try {
- this.baseURL = new URL(var1, var3);
- } catch (MalformedURLException var8) {
- }
- }
-
- if (this.baseURL == null) {
- var3 = this.getParameter("codebase");
- if (var3 != null) {
- if (!var3.endsWith("/")) {
- var3 = var3 + "/";
- }
-
- try {
- this.baseURL = new URL(var1, var3);
- } catch (MalformedURLException var7) {
- }
- }
- }
-
- if (this.baseURL == null) {
- String var4 = var1.getFile();
- int var5 = var4.lastIndexOf(47);
- if (var5 > 0 && var5 < var4.length() - 1) {
- try {
- this.baseURL = new URL(var1, var4.substring(0, var5 + 1));
- } catch (MalformedURLException var6) {
- }
- }
- }
-
- if (this.baseURL == null) {
- this.baseURL = var1;
- }
-
- }
-
- public String getParameter(String var1) {
- return (String)this.atts.get(var1.toLowerCase());
- }
-
- public URL getDocumentBase() {
- return this.documentURL;
- }
-
- public URL getCodeBase() {
- return this.baseURL;
- }
-
- public AppletContext getAppletContext() {
- return (AppletContext)((Component)this).getParent();
- }
- }
-